Skip to contentSkip to conversation

Change in openvpn[master]: Mbed TLS: Error out if we have no valid tls-groups

Openvpn-devel In review MaxF (Code Review) 2 participants 7 messages Apr 20 – Apr 27 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): gerrit.1776718304000.Ica5f37e525c3812609021750ecd3986c1420e2a4@...2715...

#1 lore raw

Attention is currently required from: plaisthos.

Hello plaisthos,

I'd like you to do a code review.
Please visit

    http://gerrit.openvpn.net/c/openvpn/+/1633?usp=email

to review the following change.

Change subject: Mbed TLS: Error out if we have no valid tls-groups
......................................................................

Mbed TLS: Error out if we have no valid tls-groups

Previously, when no valid groups were specified with the tls-groups option, the Mbed TLS build of OpenVPN would start up and run, but fail to complete a handshake, while the OpenSSL build would exit with an error. This commit changes the behavior of the Mbed TLS build to match the OpenSSL version.

Change-Id Ica5f37e525c3812609021750ecd3986c1420e2a4

---
M src/openvpn/ssl_mbedtls.c

1 file changed, 6 insertions(+), 0 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/33/1633/1

src/openvpn/ssl_mbedtls.c +6 -0
index 85c771a..8a0f7d2 100644
@@ -450,6 +450,12 @@
         }
     }
 
+    /* Check if any groups were valid. */
+    if (i == 0)
+    {
+        msg(M_FATAL, "Error: All groups in \"%s\" are invalid or unsupported.", groups);
+    }
+
     /* Recent mbedtls versions state that the list of groups must be terminated
      * with 0. Older versions state that it must be terminated with MBEDTLS_ECP_DP_NONE
      * which is also 0, so this works either way. */

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1633?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ica5f37e525c3812609021750ecd3986c1420e2a4
Gerrit-Change-Number: 1633
Gerrit-PatchSet: 1
Gerrit-Owner: MaxF <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>

#2 lore raw
In reply to a message not in the archive

Attention is currently required from: MaxF.

plaisthos has posted comments on this change by MaxF. ( http://gerrit.openvpn.net/c/openvpn/+/1633?usp=email )

Change subject: Mbed TLS: Error out if we have no valid tls-groups
......................................................................

Patch Set 1: Code-Review+2

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1633?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ica5f37e525c3812609021750ecd3986c1420e2a4
Gerrit-Change-Number: 1633
Gerrit-PatchSet: 1
Gerrit-Owner: MaxF <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: MaxF <[email protected]...>
Gerrit-Comment-Date: Mon, 20 Apr 2026 23:49:38 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes

#3 lore raw

PATCH 1/1 Mbed TLS: Error out if we have no valid tls-groups

In reply to a message not in the archive

From: Max Fillinger <[email protected]...>

Previously, when no valid groups were specified with the tls-groups option, the Mbed TLS build of OpenVPN would start up and run, but fail to complete a handshake, while the OpenSSL build would exit with an error. This commit changes the behavior of the Mbed TLS build to match the OpenSSL version.

Change-Id Ica5f37e525c3812609021750ecd3986c1420e2a4

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1633
---

This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1633
This mail reflects revision 1 of this Change.

Acked-by according to Gerrit (reflected above):
Arne Schwabe <[email protected]...>

src/openvpn/ssl_mbedtls.c +6 -0
index 85c771a..8a0f7d2 100644
@@ -450,6 +450,12 @@
         }
     }
 
+    /* Check if any groups were valid. */
+    if (i == 0)
+    {
+        msg(M_FATAL, "Error: All groups in \"%s\" are invalid or unsupported.", groups);
+    }
+
     /* Recent mbedtls versions state that the list of groups must be terminated
      * with 0. Older versions state that it must be terminated with MBEDTLS_ECP_DP_NONE
      * which is also 0, so this works either way. */
#4 lore raw

[Openvpn-devel] [PATCH applied] Re: Mbed TLS: Error out if we have no valid tls-groups

Haven't tested this, but the change is quite obvious, and it's only error handling in a particular niche case, so "reasonably safe".

Your patch has been applied to the master branch.

I'm not sure we need or want this in release/2.7 - you or Arne tell me ;-)

commit b2e3e0f0cf21a712b96efb8c053b740ca1947f54 (master)

Author: Max Fillinger
Date:   Tue Apr 21 07:53:50 2026 +0200
     Mbed TLS: Error out if we have no valid tls-groups

     Signed-off-by: Max Fillinger <[email protected]...>
     Acked-by: Arne Schwabe <[email protected]...>
     Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1633
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg36699.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#5 lore raw

Re: [Openvpn-devel] [PATCH applied] Re: Mbed TLS: Error out if we have no valid tls-groups

Hi,

Quoted 5 lines · Gert Doering

Haven't tested this, but the change is quite obvious, and it's only error handling in a particular niche case, so "reasonably safe".

Your patch has been applied to the master branch.

Quoted 7 lines

I'm not sure we need or want this in release/2.7 - you or Arne tell me ;-)

commit b2e3e0f0cf21a712b96efb8c053b740ca1947f54 (master)

Author: Max Fillinger
Date:   Tue Apr 21 07:53:50 2026 +0200

Mbed TLS: Error out if we have no valid tls-groups

Arne told me, so here we are...

commit 573ccf82e90f03de3d65fb26aac9310a25c3e4ec (release/2.7)

Author: Max Fillinger <[email protected]...>
Date:   Tue Apr 21 07:53:50 2026 +0200

Mbed TLS: Error out if we have no valid tls-groups

gert

Signature · 6 lines
"If was one thing all people took for granted, was conviction that if you 
 feed honest figures into a computer, honest figures come out. Never doubted 
 it myself till I met a computer with a sense of humor."
                             Robert A. Heinlein, The Moon is a Harsh Mistress

Gert Doering - Munich, Germany                             [email protected]...
#6 lore raw
In reply to a message not in the archive

cron2 has uploaded a new patch set (#2) to the change originally created by MaxF. ( http://gerrit.openvpn.net/c/openvpn/+/1633?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by plaisthos

Change subject: Mbed TLS: Error out if we have no valid tls-groups
......................................................................

Mbed TLS: Error out if we have no valid tls-groups

Previously, when no valid groups were specified with the tls-groups option, the Mbed TLS build of OpenVPN would start up and run, but fail to complete a handshake, while the OpenSSL build would exit with an error. This commit changes the behavior of the Mbed TLS build to match the OpenSSL version.

Change-Id Ica5f37e525c3812609021750ecd3986c1420e2a4

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1633
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg36699.html

---
M src/openvpn/ssl_mbedtls.c

1 file changed, 6 insertions(+), 0 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/33/1633/2

src/openvpn/ssl_mbedtls.c +6 -0
index 85c771a..8a0f7d2 100644
@@ -450,6 +450,12 @@
         }
     }
 
+    /* Check if any groups were valid. */
+    if (i == 0)
+    {
+        msg(M_FATAL, "Error: All groups in \"%s\" are invalid or unsupported.", groups);
+    }
+
     /* Recent mbedtls versions state that the list of groups must be terminated
      * with 0. Older versions state that it must be terminated with MBEDTLS_ECP_DP_NONE
      * which is also 0, so this works either way. */

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1633?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ica5f37e525c3812609021750ecd3986c1420e2a4
Gerrit-Change-Number: 1633
Gerrit-PatchSet: 2
Gerrit-Owner: MaxF <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>

#7 lore raw
In reply to a message not in the archive

cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/1633?usp=email )

Change subject: Mbed TLS: Error out if we have no valid tls-groups
......................................................................

Mbed TLS: Error out if we have no valid tls-groups

Previously, when no valid groups were specified with the tls-groups option, the Mbed TLS build of OpenVPN would start up and run, but fail to complete a handshake, while the OpenSSL build would exit with an error. This commit changes the behavior of the Mbed TLS build to match the OpenSSL version.

Change-Id Ica5f37e525c3812609021750ecd3986c1420e2a4

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1633
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg36699.html

---
M src/openvpn/ssl_mbedtls.c

1 file changed, 6 insertions(+), 0 deletions(-)
src/openvpn/ssl_mbedtls.c +6 -0
index 85c771a..8a0f7d2 100644
@@ -450,6 +450,12 @@
         }
     }
 
+    /* Check if any groups were valid. */
+    if (i == 0)
+    {
+        msg(M_FATAL, "Error: All groups in \"%s\" are invalid or unsupported.", groups);
+    }
+
     /* Recent mbedtls versions state that the list of groups must be terminated
      * with 0. Older versions state that it must be terminated with MBEDTLS_ECP_DP_NONE
      * which is also 0, so this works either way. */

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1633?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ica5f37e525c3812609021750ecd3986c1420e2a4
Gerrit-Change-Number: 1633
Gerrit-PatchSet: 2
Gerrit-Owner: MaxF <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>